﻿using DapperExtensions.Mapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DapperExt.Web.Models
{
    /// <summary>
    /// x_logEntity登录日志:实体类(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public partial class x_logEntity
    {
        /// <summary>
        /// 
        /// </summary>
        public x_logEntity()
        { }
        #region Model
        private int _id;
        private string _logtype;
        private string _username;
        private string _realname;
        private string _modulename;
        private string _description;
        private DateTime? _createon;
        private string _ipaddress;
        private string _ipaddressname;
        private int? _status = 0;
        /// <summary>
        /// Id自增主键
        /// </summary>
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 日志类型
        /// </summary>
        public string LogType
        {
            set { _logtype = value; }
            get { return _logtype; }
        }
        /// <summary>
        /// 用户名称
        /// </summary>
        public string UserName
        {
            set { _username = value; }
            get { return _username; }
        }
        /// <summary>
        /// 操作账号
        /// </summary>
        public string RealName
        {
            set { _realname = value; }
            get { return _realname; }
        }
        /// <summary>
        /// 日志模块
        /// </summary>
        public string ModuleName
        {
            set { _modulename = value; }
            get { return _modulename; }
        }
        /// <summary>
        /// 日志描述
        /// </summary>
        public string Description
        {
            set { _description = value; }
            get { return _description; }
        }
        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime? CreateOn
        {
            set { _createon = value; }
            get { return _createon; }
        }
        /// <summary>
        /// IP地址
        /// </summary>
        public string IPAddress
        {
            set { _ipaddress = value; }
            get { return _ipaddress; }
        }
        /// <summary>
        /// IP所在地
        /// </summary>
        public string IPAddressName
        {
            set { _ipaddressname = value; }
            get { return _ipaddressname; }
        }
        /// <summary>
        /// 状态
        /// </summary>
        public int? Status
        {
            set { _status = value; }
            get { return _status; }
        }
        #endregion Model

        //public string RoleName { get; set; }
    }

    /// <summary>
    /// 实体对象映射关系  
    /// </summary>
    [Serializable]
    internal class x_logEntityMapper : ClassMapper<x_logEntity>
    {
        public x_logEntityMapper()
        {
            base.Table("x_log");
            Map(f => f.Id).Key(KeyType.Identity);
            //Map(f => f.RoleName).Ignore();
            AutoMap();
        }
    }
}